package com.factory._14iterator;

/**
 * 迭代子模式
 * @author Qinye
 * @date 2023/8/13 16:54
 */
public class Test {
    public static void main(String[] args) {

        Aggregate aggregate = new ConcreteAggregate();
        Iterator iterator = aggregate.createIterator();
        while(!iterator.isDone()){
            System.out.println(iterator.currentItem());
            iterator.next();
        }
    }
}
